package org.aurora.remote;

import org.aurora.remote.protocol.RemoteRequest;
import org.aurora.remote.protocol.RemoteResponse;


public interface RemoteServer<T extends RemoteConnectionEventManager> extends RemoteService<T> {
    /**
     * 监听的端口号
     * @return
     */
    int listenerPort();

    <RESPONSE extends RemoteResponse> RESPONSE send(String addr, RemoteRequest request, long timeoutMillis, Class<RESPONSE> responseClazz);

    <RESPONSE extends RemoteResponse> void sendAsync(String addr, RemoteRequest request, long timeoutMillis, SendCallback<RESPONSE> sendCallback);

    void disConnect(String addr);
}
